]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Fix reloadExtension
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 24 Aug 2012 01:37:50 +0000 (22:37 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 24 Aug 2012 01:57:46 +0000 (22:57 -0300)
We need to recreate and reimport the extension here, not just reimport
the same exact code.

https://bugzilla.gnome.org/show_bug.cgi?id=682578

js/ui/extensionSystem.js
js/ui/shellDBus.js

index ac4acbb73285eb7dad596e93b546de86b8e246b3..4eb49c10fd2032f93ca342092b5b459f4d020454 100644 (file)
@@ -171,6 +171,19 @@ function unloadExtension(extension) {
     return true;
 }
 
+function reloadExtension(oldExtension) {
+    // Grab the things we'll need to pass to createExtensionObject
+    // to reload it.
+    let { uuid: uuid, dir: dir, type: type } = oldExtension;
+
+    // Then unload the old extension.
+    unloadExtension(oldExtension);
+
+    // Now, recreate the extension and load it.
+    let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
+    loadExtension(newExtension);
+}
+
 function initExtension(uuid) {
     let extension = ExtensionUtils.extensions[uuid];
     let dir = extension.dir;
index 53a6523c2014530c375e553be3f7ae1814044746..78aebab16f1a1433ebe1a6d3c18db3c9555499b0 100644 (file)
@@ -318,8 +318,11 @@ const GnomeShellExtensions = new Lang.Class({
     },
 
     ReloadExtension: function(uuid) {
-        ExtensionSystem.unloadExtension(uuid);
-        ExtensionSystem.loadExtension(uuid);
+        let extension = ExtensionUtils.extensions[uuid];
+        if (!extension)
+            return;
+
+        ExtensionSystem.reloadExtension(extension);
     },
 
     CheckForUpdates: function() {